home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
compuserve-file-archive
/
05 Programming
/
UWEDGE.MOR
< prev
next >
Wrap
Text File
|
2019-04-13
|
13KB
|
255 lines
LOADING FILES
You can load an ASCII file or a PET-ASCII (CBM) file. Selection 4 for a CBM
file, or 4a for a standard ASCII file. If the file was not created with this
editor, the margins will default to 0 (left) and 80 (right), otherwise the
editor will create the margins from information contained in the first few
bytes of the file. More on how it does this later. It's a good idea to clear
text memory before a load, though, or you will have some merged text...it's
surprised me at times. This can also be used to some advantage. After the
load, the DOS message will be displayed until you press a key to return to
the menu. There you can read the file, edit it or re-save it as either an
ASCII or PET-ASCII file. I use the latter trick to convert files all the
time.
NOTE: On either the load or save function, you can abort reading or writing
with the STOP key. Pressing this key during these i/o operations will close
all files and return you to the editor's menu.
SAVING@FILES
Same options are available, but you may want to know a few of the technical
details of the save. All blank lines are saved as a carriage return (or a
carriage return and linefeed for standard ASCII files). Also, you have the
option of adding extra carriage returns to the file to provide perforation
skips for your printer (you'll be prompted for this selection). If selected,
the editor will assume your text page is 66 lines per page. If you have your
lines per page set at 55 (function 2 from the menu), 11 carriage returns will
be added after every 55 lines. If you reload a file that has these extra
CR's, you'll see blank lines inserted in your text. Resaving such a file
without first deleting these lines could cause chaos in your page formatting,
so be sure you delete the lines prior to resaving. Also, if you save a file
that "maxed out" your text buffer, extra CR's will cause a reload to ignore
the last part of your lengthened document, so be aware of these details when
you make your choice.
All files saved by the editor contain information for setting up the left and
right margins. This information is contained in the first few bytes. To
explain this, let's assume you are saving a document with a left margin of 5
and a right margin of 75. The first 5 bytes of the file will be nulls (binary
zeros), the next byte will be a 128 (separator) and the next 5 bytes will be
nulls. To printers, nulls and 128's are transparent...they are ignored. These
characters are also ignored by most BBS systems. CIS ignores them just fine.
However, the editor does not ignore them, and uses them to set up the margins
when you load the file. If your margins were set to 0 left & 80 right, no
nulls or separator bytes will be saved in the file. This makes the editor
useful for creating or editing source code files for an assembler (like the
CBM assembler).
NOTE: nulls are added to the file whenever the save routine comes across
underlined text (reverse video). One null is used to mark the start of the
underlined text, another the end. The load routine interprets these nulls in
reverse, toggling the text between reverse video and normal whenever it comes
across one. Occasionally, you may load a file that contains extra nulls in it
(some BBS systems may add a few extra). When this happens, you'll have a lot
of unwanted reverse video text. Use CTRL K to correct it (in the edit mode).
MERGING TEXT FILES
Here's how you do it...load the first file and place the cursor past the last
line in the file (in the edit mode). Press the STOP key to take you back to
the menu and load the second file. The second file will start loading from
the line you left the cursor on when you went to the menu. Armed with that
information, one could merge (or insert) text from one file into another just
by leaving the cursor in the appropriate place in the text. You can even do
a "cut and paste" operation by opening up a gap in your text with CTRL i and
merging text from another file into the gap.
By now you have probably found out that you can leave the editor and do other
things without losing your document. If you use another wedge function that
writes to a buffer (like *b, *c, etc.), or disturb the basic start-of-variable
storage pointer, you'll have a lot of trouble recovering your document. What
you CAN do is exit to print, scratch or rename a file, read the directory, or
use any other command that doesn't disturb pointers or re-allocate buffers.
For convenience, access to the DOS commands and the directory reader are
provided from the editor menu.
PRINTING A FILE
You can use the wedge *p command to print a CBM file, or the editor's
printing routine to print directly from your text workspace.
The editor's printing routine has several additional features that the SEQ
file printer lacks, and should work with any CBM-compatible printer setup. A
bit of background on how it works will help you set it up for your printer to
use the special features (underlining and enhanced print).
You will be prompted first for the place to start printing (from the
beginning line or from the last line the cursor was on).
Next, right justification instructions. Right justification will happen only
on lines with 10 or less spaces at the end of the line, and only if the line
has at least 4 words on it (formatting safety precautions). These precautions
are necessary to prevent "ugly" lines with 4 or more spaces between words.
Next prompt is for enhanced print (user-defined...more on this later).
Next is linked printing prompt. This is for documents too big to fit into the
workspace all at once, and had to be saved in two or more files. Answering
"yes" to this prompt will cause the line counter to remember the number of
the last line it printed (so that it can page properly on a linked document).
For example, let's say you wanted to print a large document that was saved in
three files. On the first file, you would answer "no" to the prompt, but on
each of the next files, answer "y".
Next prompt is for the number of copies you want. This prompt will not be
offered if you answered "y" to the linked printing prompt.
The last prompt gives you a chance to abort printing before it starts.
Answering yes will start printing. You can stop printing (if you have to)
with the STOP key at any time. If you do, you'll be returned to the editor's
menu screen.
TECHNICAL@INFO
Two files are opened to the printer. One file is used to send commands, the
other is for text. Most non-CBM printer/interface setups allow the option of
choosing secondary addresses...usually, a secondary address of 7 is used for
upper and lower case printing, and allows conversion of PETascii to standard
ascii when sending text. Also, you can usually choose a secondary address for
what is commonly called a "transparent" mode (sending data without any
translation). On CARDCO interfaces this is 4 or 5. The editor's printing
routine is set to open files of 7,4,7 (text) and 5,4,5 (commands). The
transparent mode was chosen for commands so that you don't have to worry
about them being translated into something else on the way to the printer.
Saves a lot of confusion and weird printer antics. One rule here...you must
use different file numbers for text and command files (how to choose them
later).
The first thing the printing routine will do is send a "setup" string to your
printer. A setup string is a string of codes that one would usually use to
ensure the printer is set to all default conditions, or to make certain
special functions are set the way you want them to be. This string should
also contain the codes to disable enhanced print and underlining. You can
define this string (instructions in a moment).
Then, if you selected enhanced print, another string is sent. These are
usually the codes that enable boldface print, italics, or whatever other
feature you wish to define as enhanced print.
Next, the document is printed. Depending on how you answered the printer
prompts, you could right-justify the lines, print the document in boldface,
or both at once.
SETTING UP THE STRINGS
There are 4 strings you will have to define according to your individual
printer/interface setup. The printing routine will work if you don't, but all
strings will be sent as null strings unless you define them. This means that
your printer cannot underline or do enhanced printing as commanded from the
printing routine until you define the command strings.
The command strings are stored in a table as a series of bytes. Let's take
the setup string first (example is in decimal).
byte1 byte2 byte3 byte4 byte5 byte6
2 27 64 -- -- --
The codes for my printer to clear to all default values are 27 and 64. The
first byte in the setup string (byte1) should be the length of the string.
Then the actual codes should follow in the succeeding bytes. The setup string
can contain up to 32 bytes (length byte + 31 codes). If you had a string to
send like this... 27,64,27,45,27,88,27,92...the table should look like this:
8 27 64 27 45 27 88 27 92
The next string in the table contains the enhanced printing codes. These
codes can be for whatever you want to use for enhanced printing (boldface,
italics, shadow print, etc.). Same rules as in the setup string, but the
maximum string length is 16 bytes.
The third string is for enabling underlining. 16 bytes max.
The last string is for disabling underlining. 16 bytes max.
DEFINING THE FILES/SECONDARY ADDRESSES
The editor is defaulted to use a secondary address of 7 (in the file opening
command "open 7,4,7") for text. This will cause the printer/interface (in my
case) to expect CBM ascii (upper and lower case), and will perform a carriage
return and linefeed when it receives a carriage return. If you need a
different secondary address for this to happen with your printer, you should
reset this number to the value you need.
5 is the default secondary address for the command file (open 5,4,5). This is
the file that the editor uses to send command strings to the printer. No
translation of the codes should take place through this file. Carriage
returns will not be sent, so it doesn't matter if this address causes a
carriage/linefeed when it gets a carriage return...it'll never get one, just
escape codes/command strings.
If you want to communicate with your printer in standard ascii, all you have
to do is change a flag (details soon). When you set the flag for ascii, the
editor will also send a linefeed after each carriage return. Example:
For a CARDCO interface and Prowriter 8510 printer, if you want to communicate
in standard ascii, set the ascii flag to 0, the secondary address for text to
5 (transparent mode, no linefeed) and the secondary address for commands to
4 (transparent mode, linefeed doesn't matter).
Note that although both files are transparent mode, I chose different
addresses for text and command files. This is because the secondary address
number is also used as the file number. If the numbers were the same, the
editor would try to open the same file twice, and terminate with an error
message whenever you tried to print.
MODIFYING THE@EDITOR CODES/STRINGS
Load the wedge, but don't run it. Now you can poke the changes into the
tables and resave the new wedge. Here are the locations you will need:
HEX DECIMAL
Ascii/ CBMascii flag -> $41f8 16888 (zero for ascii, 255 for CBM)
Text file # -> $43c3 17347
Command file # -> $43c7 17351
Setup string -> $50b8 20664 to 20695
Enhanced string -> $50d8 20696 to 20711
Underline "on" string-> $50e8 20712 to 20727
U/l "off" string -> $50f8 20728 to 20743
You can make the changes with an ML monitor, or poke them in from basic.
Either way, it may help to make up a chart to aid you in making the changes.
Also, never set the length byte of any of the 4 command strings to zero, or
you'll get very strange results. If you want the editor to ignore the string,
set the first byte to 1 and the second to zero. All 4 strings are set this
way initially anyway, ready for you to redefine them.
Well, that's about it. I always appreciate hearing from other users of these
programs...many times I get additional ideas for expansion or improvement
that way. Electronic mail is easiest...On Delphi, my ID is JIMKLITZING, on
Compuserve it's 75206,2536
Hope to be hearing from you...
Jim